import request from './request'

// 获取班级列表
export function getClassList(params) {
    return request({
        url: '/class/list',
        method: 'get',
        params
    })
}

// 获取班级详情
export function getClassDetail(id) {
    return request({
        url: `/class/detail/${id}`,
        method: 'get'
    })
}

// 添加班级
export function addClass(data) {
    return request({
        url: '/class/add',
        method: 'post',
        data
    })
}

// 更新班级信息
export function updateClass(id, data) {
    return request({
        url: `/class/update/${id}`,
        method: 'put',
        data
    })
}

// 删除班级
export function deleteClass(id) {
    return request({
        url: `/class/delete/${id}`,
        method: 'delete'
    })
}

// 批量删除班级
export function batchDeleteClass(ids) {
    return request({
        url: '/class/batch-delete',
        method: 'delete',
        data: { ids }
    })
}

// 获取院系列表
export function getDepartmentList() {
    return request({
        url: '/department/list',
        method: 'get'
    })
}

// 获取专业列表
export function getMajorList() {
    return request({
        url: '/major/list',
        method: 'get'
    })
}

// 获取班主任列表
export function getTeacherList() {
    return request({
        url: '/teacher/simple-list',
        method: 'get'
    })
}

// 获取班级学生列表
export function getClassStudentList(classId) {
    return request({
        url: `/class/student-list/${classId}`,
        method: 'get'
    })
}